package tn.bergaoui.openwebapp.wicket.pages;

import org.apache.wicket.Component;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.spring.injection.annot.SpringBean;

import tn.bergaoui.openwebapp.dao.QuestionDao;
import tn.bergaoui.openwebapp.model.Question;
import tn.bergaoui.openwebapp.wicket.components.ISubmitListener;

public class QuestionEditorPanel extends BaseBeanEditorPanel<Question, QuestionDao> {

	@SpringBean(name = "questionDao")
	private QuestionDao questionDao;

	public QuestionEditorPanel(String id, Long idquestion, ISubmitListener listener,
			Component parent) {
		super(id, idquestion, listener, parent);
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	protected void addFormComponents(Form form) {

		form.add(new TextField("question", new PropertyModel(this.bean,
				"content")));
		

		
	}

	@Override
	public QuestionDao getGenericDao() {
		return questionDao;
	}

	public void setQuestionDao(QuestionDao questionDao) {
		this.questionDao = questionDao;
	}

	public QuestionDao getQuestionDao() {
		return questionDao;
	}

	

}
